package com.neutech.maplestory.util;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;
/**
 * ${陈虎}
 * 8:05
 * wp_maplestory_v1.0
 * ${"Do what you say,say what you do"}
 */

public class ImageUtil {
    private static Map<String, Image> imagesMap = new HashMap<>();
    static{
        //LOGO
        imagesMap.put("logo",GameUtil.getImage("icon/logo"));
        // hero right stand
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_right_stand" + i, GameUtil.getImage("hero/right/stand/stand1_" + i));
        }
        // hero left stand
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_left_stand" + i, GameUtil.getImage("hero/left/stand/stand1_" + i));
        }

        // hero right walk
        for (int i = 0; i < 5; i++) {
            imagesMap.put("hero_right_walk" + i, GameUtil.getImage("hero/right/walk/walk1_" + i));
        }
        // hero left walk
        for (int i = 0; i < 5; i++) {
            imagesMap.put("hero_left_walk" + i, GameUtil.getImage("hero/left/walk/walk1_" + i));
        }
        // hero left right prone
        imagesMap.put("hero_right_prone",GameUtil.getImage("hero/right/prone/prone_0"));
        imagesMap.put("hero_left_prone",GameUtil.getImage("hero/left/prone/prone_0"));
        // hero left right jump
        imagesMap.put("hero_right_jump",GameUtil.getImage("hero/right/jump/jump_0"));
        imagesMap.put("hero_left_jump",GameUtil.getImage("hero/left/jump/jump_0"));
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_right_shoot" + i, GameUtil.getImage("hero/right/shoot/shoot1_" + i));
        }
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_left_shoot" + i, GameUtil.getImage("hero/left/shoot/shoot1_" + i));
        }

        imagesMap.put("hero_right_arrow",GameUtil.getImage("arrow/right/hero_arrow"));
        imagesMap.put("hero_left_arrow",GameUtil.getImage("arrow/left/hero_arrow"));
        for (int i = 0; i < 4; i++) {
            imagesMap.put("mob01_left_stand" + i,GameUtil.getImage("mob/mob01/left/stand/stand_" +i));
        }
        for (int i = 0; i < 5; i++) {
            imagesMap.put("mob01_left_walk" + i,GameUtil.getImage("mob/mob01/left/walk/move_" +i));
        }
        for (int i = 0; i < 12; i++) {
            imagesMap.put("mob01_left_die" + i,GameUtil.getImage("mob/mob01/left/die/die1_" +i));
        }

        for (int i = 0; i < 4; i++) {
            imagesMap.put("mob01_right_stand" + i,GameUtil.getImage("mob/mob01/right/stand/stand_" +i));
        }
        for (int i = 0; i < 5; i++) {
            imagesMap.put("mob01_right_walk" + i,GameUtil.getImage("mob/mob01/right/walk/move_" +i));
        }
        for (int i = 0; i < 12; i++) {
            imagesMap.put("mob01_right_die" + i,GameUtil.getImage("mob/mob01/right/die/die1_" +i));
        }
        imagesMap.put("blood",GameUtil.getImage("blood/blood1"));
        /**
         * 道具
         */
        imagesMap.put("HP_50",GameUtil.getImage("item/HP_50"));
        imagesMap.put("HP_100",GameUtil.getImage("item/HP_100"));
        imagesMap.put("HP_300",GameUtil.getImage("item/HP_300"));
        imagesMap.put("MP_100",GameUtil.getImage("item/MP_100"));
        //道具包
        imagesMap.put("itemPackage",GameUtil.getImage("itempackage/ItemPackage"));

        //伤害值图片
        for (int i = 0; i < 10; i++) {
            imagesMap.put("power"+i,GameUtil.getImage("power/"+i));
        }
        imagesMap.put("all",GameUtil.getImage("all/1"));
        for (int i = 0; i < 21; i++) {
            imagesMap.put("earth" + i,GameUtil.getImage("all/earth/" + i));
        }
        imagesMap.put("flower",GameUtil.getImage("all/flower/0"));
        imagesMap.put("flower_2",GameUtil.getImage("all/flower/2"));
        imagesMap.put("flower_3",GameUtil.getImage("all/flower/3"));
        imagesMap.put("flower_4",GameUtil.getImage("all/flower/4"));
        imagesMap.put("flower_5",GameUtil.getImage("all/flower/5"));
        imagesMap.put("flower_6",GameUtil.getImage("all/flower/6"));
        imagesMap.put("flower_7",GameUtil.getImage("all/flower/7"));
        imagesMap.put("flower_8",GameUtil.getImage("all/flower/8"));
        imagesMap.put("flower_9",GameUtil.getImage("all/flower/9"));


        imagesMap.put("crawl",GameUtil.getImage("hero/left/rope/rope"));
        imagesMap.put("crawl",GameUtil.getImage("hero/right/rope/rope"));


    }
    private ImageUtil(){}

    /**
     * 通过图片对象的key获取图片对象
     * @param key
     * @return
     */
    public static Image getImage(String key){
        return imagesMap.get(key);
    }
}
